﻿using System;
using System.Data;
using System.Linq;

namespace LayerEntity.Persona
{
    public class ECuentasCorrientes 
    {
        #region Constructores
        public ECuentasCorrientes(IDataRecord record)
        {
            this.IdCtaCte = (int)record["num_pos"];
            this.IdBanco = (int)record["id_banco"];
            this.IdPersona = record["id_persona"].ToString();
            this.IdMoneda = (int)record["id_moneda"];
            this.IdEstado = (int)record["id_estado"];
            this.NumeroCuenta = record["num_cuenta"].ToString();
            this.Cci = record["cci_cta"].ToString();
            this.IdTipoCtaCte = (int)record["id_tipoctacte"];
        }

        public ECuentasCorrientes()
        {
            this.IdCtaCte = 0;
            this.IdBanco = 0;
            this.IdPersona = "";
            this.IdMoneda = 0;
            this.IdEstado = 0;
            this.NumeroCuenta = string.Empty;
            this.Cci = string.Empty;
            this.IdTipoCtaCte = 0;
        }

        #endregion
        #region Propiedades
         
        public int IdCtaCte { get; set; }

        public int IdBanco { get; set; }

        public string IdPersona { get; set; }

        public int IdMoneda { get; set; }

        public int IdEstado { get; set; }

        public string NumeroCuenta { get; set; }

        public string Cci { get; set; }

        public int IdTipoCtaCte { get; set; }
        #endregion

        #region Funciones
        public object[] ToObject(int operacion)
        {
            object[] ret = new object[]
            {
                this.IdCtaCte, //_num_pos
                this.IdBanco, //_id_banco 
                this.IdMoneda, //_id_moneda 
                this.IdEstado, //_id_estado 
                this.NumeroCuenta, //_num_cuenta 
                this.Cci, //_cci_cta 
                this.IdPersona, //_id_persona 
                this.IdTipoCtaCte, //_id_tipoctacte 
                operacion //_op 
            };
            return ret;
        }
        #endregion
    }
}